package com.lhkj.ct.meta.modules.gauge.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lhkj.ct.base.model.Option;
import com.lhkj.ct.meta.modules.gauge.model.entity.TblGaugeUsability;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 适用人群标签 Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2023-10-08
 */
public interface GaugeUsabilityMapper extends BaseMapper<TblGaugeUsability> {

    @Select("select id, u_name, u_type, fun_sys_username(create_by) as create_by, create_time from tbl_gauge_usability ${ew.customSqlSegment}")
    IPage<TblGaugeUsability> selectUsabilityPage(Page<TblGaugeUsability> page, @Param(Constants.WRAPPER) Wrapper<TblGaugeUsability> wrapper);

    @Select("select id as `value`, u_name as label from tbl_gauge_usability ${ew.customSqlSegment}")
    IPage<Option<String>> selectCategoryOptions(Page<TblGaugeUsability> page,@Param(Constants.WRAPPER) Wrapper<TblGaugeUsability> wrapper);
}
